What is GstRrBrowserSink
The RidgeRun GStreamer Browser Sink documentation from RidgeRun is presently being developed. |
What is GStreamer Browser Sink?
The GStreamer Browser Sink (GstRrBrowserSink) is a GStreamer sink element that renders real-time video content to a web page, in the simplest way possible. It doesn't require any external component, extra application logic, special setup or even an internet connection.
GStreamer Browser Sink was designed for applications that wish to render video to a web application without the hassle of streaming infrastructure. Is not meant to be a replacement of existing streaming protocols.
What is the Difference with Other Streaming Solutions?
Several network streaming solutions exist already. In theory, most of them could be used to achieve the use case that GstRrBrowserSink solves. However, there are several downsides to each of them:
- HLS, LL-HLS, DASH, LL-DASH, RTMP:
- Pros: Native support on browsers
- Cons: Not real-time, high latency.
- RTSP, SRT, RIST:
- Pros: Real time, reliable, low latency
- Cons: No browser support
- WebRTC, Media-over-Quic (MoC), RTP-over-Quic (RoC):
- Pros: Browser support, real time, reliable, low latency
- Cons: Complex setup, need for external components
A seemingly simple task of rendering a video in a browser in real time becomes unexpectedly complex, requiring even expert domain knowledge. The stack becomes fragile and consumes unnecessary amounts of compute resources. We built GstRrBrowserSink to solve this, because we had this necessity ourselves.
GStreamer Browser Sink is designed to be plug-and-play, so you can invest time in actual product value.
How does Browser Sink Work Underneath?
GStreamer Browser Sink is a stripped down version of WebRTC. It removes all the non-essential components that build the protocol and keeps only what is strictly required to stream reliably to a browser. More specifically:
- STUN and TURN servers are disabled. This is done to simplify the implementation and improve startup time. On the other hand, this means that streaming will only work in a local network. If you need NAT traversal, you're better off with plain WebRTC (or use a VPN).
- The signaler is built into the element. GstRrBrowserSink implements a WHEP based signaler internally. This is a standard protocol that many players understand, and based on plain HTTP requests. When the pipeline starts, a WHEP endpoint will be automatically available to initiate the streaming.
- Video formats support is limited. This is a major pain point in most WebRTC implementations. Trying to correctly support multiple browser codecs with the ones supported in GStreamer is the source of multiple errors. In order to improve robustness, Browser Sink supports (and has been tested) with a large range of browsers and H.264 encoders, including HW accelerated ones. There is not plans for supporting other codecs until that codec becomes deprecated. (Of course, you can also sponsor the support of a different codec, if you really want it).
- Data channel and audio are disabled. If you need these, you're probably better off with the full WebRTC protocol.
We have worked with WebRTC extensively over the years. We have learned that in many scenarios, customers don't need the majority of the features and they only add complexity to the end solution. GStreamer Browser Sink was built to cover this recurring requirement.
Current Features and Limitations
At the time of this writing, GStreamer Browser Sink exposes the following features:
- Plug-and-play operation
- H.264 video streaming
- Low latency (< 200ms)
- Multi-browser support in desktop and mobile
- Simple web page integration
Similarly, it has the following limitations (some of them by design):
- Only H.264 is supported and tested
- No audio or data channel support
- Local-network streaming only